package cn.qingxuntech.console.service

import cn.qingxuntech.console.entity.Account
import cn.qingxuntech.console.mapper.AccountMapper
import com.mybatisflex.core.query.QueryWrapper
import org.springframework.stereotype.Service
import org.springframework.beans.factory.annotation.Autowired

@Service
class AccountService {

    @Autowired
    lateinit var accountMapper: AccountMapper

    fun login(loginName: String?, loginPassword: String?): Account? {
        return accountMapper.selectOneByQuery(
            QueryWrapper.create()
            .eq(Account::loginName, loginName)
            .eq(Account::loginPassword, loginPassword))
    }
}